// 独一无二的 symbol
/**
 * @author Ou
 */
let s = Symbol();// 大写首字母 创建，简单数据类型 不能 new，BigInt()一样 let b1 = BigInt(1);
console.log(typeof s);// symbol
let s2 = Symbol();
console.log(s == s2);// false

let s3 = Symbol('foo');
let s4 = Symbol('foo');
console.log(s3 == s4);// false

let obj2 = {
    name: 'Ou',
    age: 21
};
const o = require('./2.js');
console.log(o);// { name: 'Cavan', age: 18 }

let newObj = {
    ...o,
    name: 'C',
}
console.log(newObj);// { name: 'C', age: 18 } , name 发生了覆盖

// 为了唯一性 symbol
let s1 = Symbol('name');
let newObj1 = {
    ...o,
    [s1]: 'C',
}
console.log(newObj1);// { name: 'Cavan', age: 18, [Symbol(name)]: 'C' }
